class Solution {
    public boolean validPalindrome(String s) {
        int left = 0;
        int rigth = s.length() - 1;
        int a = 0;
        while (left < rigth) {
            if (s.charAt(left) == s.charAt(rigth)) {
                left++;
                rigth--;
                continue;
            }
            if(a == 0) {
                left++;
                a++;
            } else if(a == 1) {
                left--;
                rigth--;
                a++;
            } else {
                return false;
            }
        }
        return true;
    }
}